var OLDPPosition = OpenLayers.Class({
	initialize: function( options ) {
		// dummy
	},
	
	getHiddenId: function ( name ){
		return this.options.divID+'_'+name;
	},
	
	getInputName: function ( name ){
		return 'dpposition_'+name+'[]';
	},
	
	setHidden: function ( name, value ){
		var id = this.getHiddenId(name);
		if( jQuery('#'+id).size() === 0 ){
			jQuery('#'+this.options.divID).append('<input id="'+id+'" type="hidden" name="'+this.getInputName(name)+'" value="'+value+'" />');
		}else if( jQuery('#'+id).size() === 1 ){
			jQuery('#'+id).val(value);
		}
	},
	
	removeHidden: function ( name ){
		jQuery('#'+this.getHiddenId(name)).remove();
	},
	
	getDivId: function ( name ) {
		return this.options.divID+'_'+name;
	},
	
	getFormRowHTML: function( row ){
		return '<div class="'+OLDPPositionStyle.form_row+'">'+row+'</div>';
	},
	
	getLabelHTML: function( label, required ){
		if( !label ){
			label = '&nbsp';
		}else if( label.length < 1 ){
			label = '&nbsp';
		}
		return '<div class="'+OLDPPositionStyle.label+'">'+this.getRequiredHTML(required)+label+'</div>';
	},
	
	getValueHTML: function( value ){
		return '<div class="'+OLDPPositionStyle.value+'">'+value+'</div>';
	},
	
	getRequiredHTML: function( required ){
		return '<div class="'+OLDPPositionStyle.required+'">'+(required ? '*' : '&nbsp;')+'</div>';
	},
	
	getDisabledHTML: function( value ){
		return this.getValueHTML('<div class="'+OLDPPositionStyle.disabled+'">'+value+'</div>');
	}
});

// constants
OLDPPosition.STATUS_USER       = 0;
OLDPPosition.STATUS_PREDEFINED = 1;